﻿using com.guojin.core.io;
using com.guojin.core.io.message;

namespace com.guojin.mj.net.message.game
{
    public class PlayCardRet : Message
    {
        public static int TYPE = 12;
        public static int ID = 11;

        public int LocationIndex { get; set; }           //出牌玩家的编号
        public int BetType { get; set; }                  //0 玩家点击没牛按钮，有牛也按照没牛计算   1 玩家正常出牌
        public int[] Cards { get; set; }                      //前三张为玩家选中的牌，后两张为附带； 如果前三张能够组成牌型，玩家本轮按照此牌型算牛。五小牛，五花牛，炸弹无论前三张是什么，只要不是时间到自动出牌或者选择没牛，都按照牌型计算。
        public string CardType { get; set; }             //玩家牌型

        public void decode(Input _in)
        {
            LocationIndex = _in.readInt();
            BetType = _in.readInt();
            Cards = _in.readIntArray();
            CardType = _in.readString();
        }

        public void encode(Output _out)
        {
        }

        public int getMessageId()
        {
            return ID;
        }

        public int getMessageType()
        {
            return TYPE;
        }

        public string toString()
        {
            return string.Format("PlayCardRet[locationIndex={0}, BetType={1}, cardType={2}]", LocationIndex,
                BetType, CardType);
        }
    }
}